#ifndef TRANSLATOR_H
#define TRANSLATOR_H
#include "translator_global.h"

#include "..\SceneData\ContainerNode.h"
#include "..\SceneData\PathNode.h"
#include "..\SceneData\PictureNode.h"
#include "..\SceneData\SymbolNode.h"
#include "..\SceneData\SceneNode.h"
#include "..\SceneData\RectNode.h"
#include "..\SceneData\MovieClipNode.h"
#include "..\SceneData\EclipseNode.h"
#include "..\SceneData\WordShapeNode.h"
#include <QString>
#include <QVector>
class TRANSLATOR_EXPORT Translator
{
private :
	//ContainerNode * root;
	QString script_preload;
	QString script_loaded;
	QVector<QString> script_lib;
	QString script_output;
	int manifest_pos;
	int width;
	int height;
	QColor bk;
	unsigned int symbol_id;
	unsigned int shape_id;
	unsigned int pic_id;
	unsigned int mclip_id;
	unsigned int container_id;
	QString project;
	//QVector<int> res_id;
	QVector<QImage> res_ref;


	void parsePathNode(PathNode* pt,int pos);
	void parsePictureNode(PictureNode *pt,int pos);
	void parseRectNode(RectNode *pt,int pos);
	void parseEclipseNode(EclipseNode *pt,int pos);
	void parseSymbolNode(SymbolNode *pt,int pos);
	void parseMovieClipNode(MovieClipNode *pt,int pos);
	void parseAnimation(int flag,ContainerNode* pt,QString Property,QString& out);
public:
    Translator();
	//Translator(const QString & proj_name);
	//void setProject(const QString & name){project=name;}
	void parseRootNode(ContainerNode *root);
	void Initialize(SceneNode *scene);
	void Clear();
	const QString& Result(){return script_output;}
	bool Output(const QString & path);
};

#endif // TRANSLATOR_H
